import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { TestaComponent } from './testa/testa.component';
import { TestbComponent } from './testb/testb.component';
import { TestcComponent } from './testc/testc.component';
import { TestLayoutComponent } from './test-layout/test-layout.component';

const routes: Routes = [
    {
        path: '', component: TestLayoutComponent, data: {title: 'title for layout', order: 0},
        children: [
            { path: '', redirectTo: 'a', pathMatch: 'full', data: {title: 'title for default', order: 1} },
            { path: 'a', component: TestaComponent, data: {title: 'title for test a', order: 2} },
            { path: 'b', component: TestbComponent, data: {title: 'title for test b', order: 3} },
            { path: 'c', component: TestcComponent, data: {title: 'title for test c', order: 4} },
        ]
    }
  ];
@NgModule({
    imports: [ RouterModule.forChild(routes) ],
    exports: [ RouterModule ],
})
export class TestRoutingModule {}
